#include <iostream>
#include <queue>
using namespace std;

int n = 0;
int k = 0;
long long sum;
int tmp = 0;
priority_queue<int> heap;

int main()
{
    cin >> n >> k;
    for (int i = 0; i < n; ++i)
    {
        cin >> tmp;
        sum += tmp;
        if (tmp % 2 == 0)
            heap.emplace(tmp); // 偶数放入大堆
    }

    // 进行k次操作
    while (k-- && !heap.empty())
    {
        tmp = heap.top() / 2;
        heap.pop();
        sum -= tmp; // 减去最大偶数的一半
        if (tmp % 2 == 0)
            heap.emplace(tmp);
    }

    cout << sum << endl;

    return 0;
}
